package cn.itsource.api;

import cn.itsource.constants.Constants;
import cn.itsource.fallback.CustomerApiFallback;
import cn.itsource.pojo.result.CustomerInfo;
import cn.itsource.result.JSONResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = Constants.Remote.SERVICE_CUSTOMER,fallbackFactory = CustomerApiFallback.class)
@Tag(name = "乘客远程API",description = "乘客远程API")
public interface CustomerApi {

    @GetMapping("/remote/customerFine/hasFine/{customerId}")
    @Operation( summary= "是否有罚款",description = "是否有罚款")
    @Parameter(name = "customerId",description = "乘客ID",required = true)
    JSONResult<Boolean> hasFine(@PathVariable Long customerId);


    @GetMapping("/remote/customer/info/{customerId}")
    @Operation( summary= "查询乘客信息",description = "查询乘客信息")
    @Parameter(name = "customerId",description = "乘客ID",required = true)
    JSONResult<CustomerInfo> get(@PathVariable Long customerId);

}
